package day1.p6;

public class StrLenPal {
	public static void main(String[] args) {
		if (args.length < 1) {
			System.out.println("No input found.");
			return;
		} else {
			if (args.length > 1) System.out.println("Multiple inputs found.");
			System.out.println("First input selected.");
			System.out.println("Word is " + args[0]);
			System.out.println("Length is " + args[0].length());
			String pal = args[0].toUpperCase();
			int first = 0;
			int last = pal.length() - 1;
			while (first <= last)
				if (pal.charAt(first++) == pal.charAt(last--))
					;
				else {
					System.out.println("Its not a palindrome");
					return;
				}
			System.out.println("Its a palindrome");
		}
	}
}
